package org.emergency.framework.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.emergency.framework.constant.ModelConstant;

/**
 * TbRolePermission entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TB_ROLE_PERMISSION", catalog = ModelConstant.DB_CATALOG)
public class TbRolePermission implements java.io.Serializable {

	private static final long serialVersionUID = 8902450383740278146L;
	
	@Id
	@Column(name="TB_ROLE_PERMISSION_ID",length=ModelConstant.STRING_LENGHT_id)
	private String tbRolePermissionId;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TB_ROLE_ID", nullable = false)
	private TbRole tbRole;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "P_ID",nullable = false)
	private TbPermission tbPermission;

	// Constructors

	/** default constructor */
	public TbRolePermission() {
	}

	/** full constructor */
	public TbRolePermission(String tbRolePermission, TbPermission tbPermission,
			TbRole tbRole) {
		this.tbRolePermissionId = tbRolePermission;
		this.tbPermission = tbPermission;
		this.tbRole = tbRole;
	}
	
	public String getTbRolePermissionId() {
		return tbRolePermissionId;
	}

	public void setTbRolePermissionId(String tbRolePermissionId) {
		this.tbRolePermissionId = tbRolePermissionId;
	}

	
	public TbPermission getTbPermission() {
		return this.tbPermission;
	}
	
	public void setTbPermission(TbPermission tbPermission) {
		this.tbPermission = tbPermission;
	}
	
	public TbRole getTbRole() {
		return this.tbRole;
	}

	public void setTbRole(TbRole tbRole) {
		this.tbRole = tbRole;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	

}